<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/31
 * Time: 19:00
 */

if ($_POST && strlen($_POST['key']) == 9) {
    require_once "config.php";
    require_once "MyPDO.class.php";
    $db = MyPDO::getInstance($host, $user, $pass, $dbName, 'utf8');
    $key = $_POST['key'];
    $arr = $db->query('invite_list', "`key` LIKE '$key%'", "Row");
    if ($arr['id']) {
        $json['type'] = $arr['type'];
        //$json['user'] = $arr['user'];
        $json['status'] = 'success';
    } else {

        $json['status'] = 'error';

    }
    echo json_encode($json);
}